@extends('layout')
@section('content')
<div class="panel panel-success">
      <div class="panel-heading">
      <h3><left><a class="glyphicon glyphicon-th-list text-success"></a></left>Lista de Ganados asociados a Potreros</h3>
      </div>
    </div>
      <div class="panel-body">
        <table class="table table-hover">
        <thead>
          <tr>
            <Th> ID POTRERO</ th>
            <Th> COD POTRERO</ th>
               <Th> COD Ganado </ th>              
                <Th> Estado </ th>
                  <th>Acciones</th>            
        </thead>
        <tbody>

        

          @foreach($potrero as $potrerog)
            <tr>
            <td> {{$potrerog->id}} </td> 
            <td>
                @foreach($var2 as $var)
                @if($potrerog->id_potrero == $var->cod_potrero)
                 {{$var->cod_potrero}} 
                  @endif
                  @endforeach
           </td>

            <td>
            @foreach($ganado as $gan)
                    @if($potrerog->id_ganado == $gan->id)
                    {{$gan->cod_ganado}} 
                    @endif
                  @endforeach
                </td>
                      <td>
            @if ($potrerog->activo == 0) 
                              <p>Inactivo</p> 
                              @else 
                                 <p>  activo</p> 
                                    @endif    
                      </td>  
            <td> 
           <a>{{ Form::open(array('url' => 'ganadopotrero/'.$potrerog->id, 'method'=> 'delete')) }}
               {{ Form::submit('Desasociar',  array('class' => "btn btn-danger"))}}
               {{ Form::close() }}</a>
            </td>          
                     </tr>
         
          @endforeach
      </tbody>
      </table>
    {{$potrero->links()}}        
      </div>
      <div>
            <a href="{{URL::to('potreros')}}" class="btn btn-success" data-dismiss="modal">Regresar</a>
    </div>
    </div>
@stop